package com.ins.model.dto.app;

import com.ins.model.dto.BaseDTO;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 订单表(AppOrder)实体类
 *
 * @author ins
 * @since 2024-05-14
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class AppOrderDTO extends BaseDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 434801868812696584L;

    @Valid
    @NotEmpty(message = "请选择购买信息")
    private List<AppOrderItemDTO> items;

    /**
     * 优惠券id
     */
    private Long couponId;

    /**
     * 订单总金额
     */
    @NotNull(message = "总金额错误")
    private BigDecimal totalAmount;

    /**
     * 应付金额（实际支付金额）
     */
    @NotNull(message = "支付金额错误")
    private BigDecimal payAmount;

    /**
     * 订单来源：0->PC订单；1->app订单
     */
    private Integer sourceType = 1;

    /**
     * 订单类型：0->正常订单；1->秒杀订单
     */
    private Integer orderType = 0;

    /**
     * 订单备注
     */
    private String remark;

}

